//
//  XMFirstVC.m
//  TestView
//
//  Created by lk@wxm on 2024/12/4.
//

#import "XMFirstVC.h"
#import "XMScondCtr.h"
#import "XMThirdVC.h"
#import "XMFourDimGrid.h"
@interface XMFirstVC ()
@property(nonatomic,strong)UIButton *clickBtn;
@property(nonatomic,strong)UIButton *clickBtn1;
@end

@implementation XMFirstVC
- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];

}
-(UIButton *)clickBtn{
    if (!_clickBtn) {
        _clickBtn = [[UIButton alloc]initWithFrame:CGRectMake(100, 100, 200, 50)];
        [_clickBtn setTitle:@"方法1" forState:UIControlStateNormal];
        [_clickBtn setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
        [_clickBtn addTarget:self action:@selector(jump) forControlEvents:UIControlEventTouchUpInside];
    }
    return _clickBtn;
}
-(UIButton *)clickBtn1{
    if (!_clickBtn1) {
        _clickBtn1 = [[UIButton alloc]initWithFrame:CGRectMake(100, 150, 200, 50)];
        [_clickBtn1 setTitle:@"方法2" forState:UIControlStateNormal];
        [_clickBtn1 setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
        [_clickBtn1 addTarget:self action:@selector(jump1) forControlEvents:UIControlEventTouchUpInside];
    }
    return _clickBtn1;
}
- (void)jump{
    //第一种方法
    [self.navigationController pushViewController:[[XMThirdVC alloc]init] animated:YES];
}
- (void)jump1{
    //第二种方法
    [self.navigationController pushViewController:[[XMScondCtr alloc]init] animated:YES];
    
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.title = @"首页";
    [self.view addSubview:self.clickBtn];
    [self.view addSubview:self.clickBtn1];
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller. [[[XMFourDimGrid alloc]init]creatMapWithSize:8];
}
*/

@end
